package com.ruoyi.cms.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "9021000139666926";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCHHNbhJv935DrWXaEgd2TCfSgTLNkd9ZS3rcYGuE93QwJsPuQCtz3RnJKmWR0j1CZuJYnKgh0acgzSDVSQhAgZMR6Kk+6PFpGo5oArPJXLZZZqPi0fWdPPPDiZJWGAVRvk/6tVjLTE6SVDXnaF+lQEcvF8GklwcOwFY8ls5YJieJ+ILh3nlcjTsgXeTjuEt4kHKdhPyvq4fNMWoS1drqycv8d7lfD8A7yz+l8XTsCMEkuIY96MMeiN2SdSdmZfEIGkMpywfM+3ZQmXadszKsyWzwEhp9cTyR3uxZoW508e7TDDQfwdSijIz8Hfggrqe55YAH3fNvdLnWshV1shY3nBAgMBAAECggEBAIcXj8YJTw+Z9DZX4X3rwqQvrX0Wr3OkE3Ff34riiBnvtyFx9Fq+yqGlkn+exGMJgO9Kuy3u0JibhjQTvgTM7qf5k9btOG57G2KsLWSNrBx1U2KhDk61avFe/hwp4wYEkuJxu+bKzAfCMU7dyVYGSDE2mDsEsX8qeOKetkwaYjZ/e/V7AdArfhXeZVwE1A1D1Lb0oz4xmfaZdcr9nNw7fuPWqsyjMSGNwIcKHSY/t5evjLkDe/c8waCTGBTu5DQ6XFJ/6IGgoNwXs5RAK+K7M93cGURXVu0bPTctrytSVeez5VGNkzQQLHAtDT7pqUisdvG4DlnBmFc3ERCk4O3JiVECgYEA0s9ZLA5PxRpp2mVrPv3trKWhavaGlLLechKWgDb1dOcymZv8fx1gHCEXUsrVD07XDNLVc6V4WO3bS8MM/0m6nfEpIWLpM0J1Bw8VJfytw01XBj5jfZoFfBH50vRlXlXQPAIQ2n/3m+TbQcykjsDto4rxFZm+JEWQC6HCtuEoTeUCgYEApBNwKgMSLaVk/UHY3RmXI55ANZx56r8Vec92bBaXS2ToyXTDspYrMkI3khTQ3nZrHPvOri5eW43Uf3Mlb46DlcFvweSFyHvDsE184302bzT9S3KoyL061rs8ssHJCQ7tnBGgEMIXd0/Yza2hBNcGVGoG7OdSkZTw/ThqMi+OHq0CgYALQUzGgGEb6eQa5+1I6K/G1vT+S/k1eTNNLdbhM435Vtqpvt1FQCFAfzfKkM+9SH1MzvjcesopHVHnApvwCVSwWA7VHH3M4dBztwdvBsWUNs3dpHkVXKLMU/1dmPTMi5JZkdaqg8iJhzd5lN54TK6jW6ixeYrgTuJ47IMD1pObTQKBgCoP9aQ/j0x2ZzJpzA+6fL2b1zgnOjYM8JN+tQw2qmigoPDsZzMEPmSvBxIDFhzB3OncP/r1VilAbeaSfVlg/qjIoz7gt89SszMiWk7zjZ3qxrit10lHAauE6qWk+kXBNvbYqeFB8MQciycHSQ01lqDTYZ0gHFHIDhPMf6UH/fYtAoGAATX6nNcYC6p3DENtV2m5D6DvxzipmM5wQ/bDVR9bt+XY8ljliDCATtpH2vmQMUSfwd1pAdJ6R4phAvMJr+fOQLD6R19Zaq6GWyRVy9Cc3Q2NAfAnrTfSfRYfxglIncM2hUajBO3O0M4/IqhmL12RJ54sh42D8fAzKjohhOoPhGs=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlHgEy4tlkWTnkq1oK0N7FI/kX4QFkn/XiZNPGT/RkolWXpkiCvMd93hM54bqlLpdXEAXQaHA5u9Hm/EWkYJU0YZPkOYEeK7VNDGuk6ApLVwyxNL1FzYSAcjFFGZqcAMFJIeSB7ysmCxoygWzuiDxwrLsgJ+4SQmggHnsmyLijzYUSsg/nTNVeSPLJ3B5ts8050PsDrp4RSelZgRydoF+TOGaYxcNj+iKrNNjgv5mVJ6zaJX/DkCqZmWnfDKUTDbI5vTrBRSSP13pAVRN0bQsgo0AwvshgllcC/hm3uQISThhjczx+Ors0jxoL6EQ6+fuSxPIvEzP5QoSG4vicJLmiwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://wxpaydxn.free.idcfengye.com/pay/alipayNotify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:9301/pay/alipayReturn";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

